#ifndef __SORT_N_H_
#define __SORT_N_H_

#include "mytype.h"

#ifdef __cplusplus
extern "C"
{
#endif

	void i32_bubble_sort(int32_t arr[], size_t Len);
	void u32_bubble_sort(uint32_t arr[], size_t Len);
	void i16_bubble_sort(int16_t arr[], size_t Len);
	void u16_bubble_sort(uint16_t arr[], size_t Len);
	void i8_bubble_sort(int8_t arr[], size_t Len);
	void u8_bubble_sort(uint8_t arr[], size_t Len);

	void i32_select_sort(int32_t arr[], size_t Len);
	void u32_select_sort(uint32_t arr[], size_t Len);
	void u16_select_sort(uint16_t arr[], size_t Len);
	void i16_select_sort(int16_t arr[], size_t Len);
	void i8_select_sort(int8_t arr[], size_t Len);
	void u8_select_sort(uint8_t arr[], size_t Len);

	void strlist_select_sort(const char *list[], size_t n);
	
	void i32_insert_sort(int32_t arr[], size_t length);
	void i16_insert_sort(int16_t arr[], size_t length);
	void str_insert_sort(const char * arr[], size_t length);
	
	void i32_shell_sort(int32_t arr[], size_t n);
	void i16_shell_sort(int16_t arr[], size_t n);
	void str_shell_sort(const char * arr[], size_t n);

	void str_shell_bisect_sort(const char* arr[], size_t n);

	extern const int shell_sedgewick[];
	int shell_sedgewick_get(int n);

	void i32_select_sort_cut(int32_t arr[], size_t n, size_t cut_len);
	void u32_select_sort_cut(uint32_t arr[], size_t n, size_t cut_len);
	void i16_select_sort_cut(int16_t arr[], size_t n, size_t cut_len);
	void u16_select_sort_cut(uint16_t arr[], size_t n, size_t cut_len);
	void i8_select_sort_cut(int8_t arr[], size_t n, size_t cut_len);
	void u8_select_sort_cut(uint8_t arr[], size_t n, size_t cut_len);
    
    void blk_select_sort32(uint8_t *blk_mem, int blk_size, int blk_amount);
	
	void blk_select_sort16(uint8_t *blk_mem, int blk_size, int blk_amount);

	void blk_offset_select_sort16(uint8_t *blk_mem, uint32_t offset, int blk_size, int blk_amount);
	void blk_offset_select_sort32(uint8_t *blk_mem, uint32_t offset, int blk_size, int blk_amount);
	
#ifdef __cplusplus
}
#endif

#endif 
